package src.com.foreknow.demo2;

import java.util.Scanner;

/**
 * 用户如何从控制台输入数据
 * Scanner
 */

public class ScannerDemo {
    public static void main(String[] args) {
        //1.创建一个Scanner
//        Scanner input = new Scanner(System.in);
//        System.out.println("请输入一个数");
//        //2.从控制台来接受用户的输入
////        int num = input.nextInt();
////        System.out.println(num);
//        int i = input.nextInt();
//        char c = (i % 2==0 )?'是':'否';
//        System.out.println(c);

        Scanner input = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name = input.next();
        System.out.println("请输入性别：");
        String sex = input.next();
        System.out.println("请输入年龄：");
        int age = input.nextInt();
        System.out.println("请输入薪水：");
        double salary = input.nextDouble();

        System.out.println("用户名:" + name + "性别:" + sex +"年龄：" + age + "薪水" + salary);



    }
}
